prepare("select * from payroll where sn = $id") ; $getd->execute() ; $row = $getd->fetch(pdo::FETCH_ASSOC) ; $staff = $row['staff_id'] ; $pos = $row['designation'] ; $bs = $row['Basic_Salary'] ; $ta = $row['Transport_Allowance'] ; $ha = $row['House_Allowance'] ; $ma = $row['Medical_Allowance'] ; $wa = $row['Wardlobe'] ; $gs = $row['Gross_salary'] ; $oa = $row['Other_Allowance'] ; if(isset($_POST['submit'])) { $username = trim($_POST['staffid']) ; $pos1 = trim($_POST['pos']) ; $bs1 = trim($_POST['bs']) ; $ta1 = trim($_POST['ta']) ; $ha1 = trim($_POST['ha']) ; $wa1 = trim($_POST['wa']) ; $ma1 = trim($_POST['ma']) ; $gs1 = trim($_POST['gs']) ; $oa1 = trim($_POST['oa']) ; $upd = $DBcon->prepare("update payroll set staff_id =:a, designation = :b, Basic_Salary = :c, Transport_Allowance = :d, House_Allowance = :e,Wardlobe = :f, Medical_Allowance = :g, Other_Allowance = :h, Gross_salary= :i where sn = $id") ; $upd->bindparam(":a",$username) ; $upd->bindparam(":b",$pos1) ; $upd->bindparam(":c",$bs1) ; $upd->bindparam(":d",$ta1) ; $upd->bindparam(":e",$ha1) ; $upd->bindparam(":f",$wa1) ; $upd->bindparam(":g",$ma1) ; $upd->bindparam(":h",$oa1) ; $upd->bindparam(":i",$gs1) ; if($upd->execute()) header("location: payro.php") ; } ?>